<!DOCTYPE html>
<html>
<head>
	<script src="./javascripts/jquery-3.2.1.min.js"></script>
	<script src="./javascripts/json2.js"></script>
	<script src="./javascripts/json_parse.js"></script>
</head>
<body>
	<div>
	    <button onclick="getInhouseData()">获取入库数据</button>
		<button onclick="getOuthouseData()">获取出库数据</button>
		<button onclick="computeData()">处理数据</button>
		<button onclick="importData()">存入数据库</button>
	</div>
	<div>
		<h5 id="tips"></h5>
	</div>
	<script type="text/javascript">
		function getInhouseData(){
			var _url ='http://localhost:3000/getInhouseData';
			$.ajax({
				type: 'get',
				url: _url,
				dataType: 'json',
				success: function(result) {
					if(result != null) {
						$('#tips').text('Load Data Success!');
					}
				},
				error: function(xhr, status, error) {
					
				}
			});
		}

		function getOuthouseData(){
			var _url ='http://localhost:3000/getOuthouseData';
			$.ajax({
				type: 'get',
				url: _url,
				dataType: 'json',
				success: function(result) {
					if(result != null) {
						$('#tips').text('Load Data Success!');
					}
				},
				error: function(xhr, status, error) {
					
				}
			});
		}

		function computeData(){
			var _url ='http://localhost:3000/computeData';
			$.ajax({
				type: 'get',
				url: _url,
				dataType: 'json',//服务器返回的数据类型
				success: function(result) {
					if(result != null) {
						$('#tips').text('Deal Data Success!');
					}
				},
				error: function(xhr, status, error) {
					
				}
			});
		}

		function importData(){
			var _url ='http://localhost:3000/importData';
			$.ajax({ 
				type: 'get',
				url: _url,
				dataType: 'json',
				success: function(result) {
					if(result != null) {
						$('#tips').text('ImportData Data Success!');
					}
				},
				error: function(xhr, status, error) {
					
				}
			});
		}
	</script>
</body>
</html>